This invention relates generally to the field of computer graphics display, and more particularly to using the alpha channel for generating screen space effects in a high fidelity computer graphics simulation system.
For a few years, 3D graphics systems designed for high end workstations have included what is known as an alpha (xcex1) channel. The alpha channel is used for compositing images. That is, combining images to create a new image. Compositing is a good way to produce images since it is easy to do, where the rendering of images is more difficult and computationally expensive. If one portion of the image needs alteration, the whole image does not need to be generated. In fact, some portions of the compositing may not be rendered but have been optically scanned into memory. Then compositing may be the only way to combine them into the image.
The value of each pixel in a composited image is computed from the component images in some fashion. If the pixels are combined in an overlay, the pixels of the foreground must be given transparency values as well as their color values. This way a pixel""s value is taken from the background image unless the foreground image has an opaque value for that pixel. Images can also be blended, so the final pixel value is a linear combination of the values of the two component values. To implement these and other operations in this group, each pixel is given an alpha value along with the normal red, blue, green (RGB) color values. The storage buffer area allocated for these alpha values is commonly known as the alpha buffer. The related hardware processing circuits are commonly known as the alpha channel. The alpha field generally has a value from 0 to 1, where 0 is transparent and 1 is opaque. This value may also be indexed into a lookup table containing transparency values.
The concept of an alpha channel has been formalized into graphics application programmer interfaces (APIs) such as OpenGL by Silicon Graphics or DirectX by Microsoft. If hardware acceleration of the alpha channel is needed, the RGBA (red-green-blue-alpha) scheme mandates a separate processing channel for processing the alpha values and memory storage for the alpha values in the frame buffer. A hardware implementation is required to accelerate all of the blending modes which are outlined in the defined APIs. For example, there are blend modes in which the xe2x80x98sourcexe2x80x99 alpha from the graphic accelerator hardware is blended with a xe2x80x98destinationxe2x80x99 alpha previously stored in the frame buffer. This is the general case used in image compositing and this case is founded on 2 basic assumptions. First, alpha blending assumes that there is no information about the overlap of the coverage information within a pixel. All that is known is the alpha value. Second, the shape of the pixel area covered by any object is unknown but the total area covered is known. In this case, the alpha represents a fraction of the pixel area covered.
These assumptions lead to the result that when alpha is used to antialias edges and/or represent transparency in simulated real world objects, overlapping primitives must be processed in back to front order to obtain visually correct results. The usual practice in such scenarios is to turn off the antialiasing for the best performance through utilization of the Z-buffer. On the other hand, the antialiasing can be turned on for the best scene quality which produces a performance degradation from sorting the primitives.
Accordingly, some advanced graphics systems use an alternate method of anti-aliasing where each pixel consists of subpixels. This is known as subpixel antialiasing or multi-sample mode. For this type of antialiasing, the two basic assumptions of alpha compositing do not apply. The information about overlap coverage and the shape of the pixel area covered is known because of the storage of geometrically correlated subpixel information. Thus, a high quality antialiased scene can be produced from unordered primitives which eliminates the performance degradation due to sorting. In this method, antialiasing alpha coverage information is redundant. When graphics systems are using multi-sample mode, the alpha memory is not needed. It is nevertheless present to be compliant with graphics standards which require alpha storage. In subpixel antialiasing mode, alpha processing hardware is not needed except in the case of partially transparent polygons.
In addition to antialiasing, advanced graphics systems also desire to include advanced screen space effects. This includes effects such as the illumination effects of a vehicle mounted light source and the attenuation of the illumination due to the distance of an illuminated surface from the light source. This is known as range attenuation Other screen effects such as the simulation of dusk/night scenes, edge blending attenuation and double buffered bitmap overlays are also desired. The creation of such screen elements is conventionally performed through the graphics pipe before the pixel data enters the frame buffer. Elements such as generating lobes for vehicle-mounted light sources are normally taken care of in the rendering process. For example, U.S. Pat. No. 5,384,719 to Baker, incorporated by reference herein, teaches simulating the illumination effects of a vehicle mounted light source and these effects are produced through the rendering process. The problem with producing screen space effects during the rendering and conversion steps is that it adds significantly to the processing overhead and slows the graphics subsystem down. One way to overcome this problem is to provide dedicated hardware to take care of the screen effects. This increases the cost and hardware real estate requirements for a real time graphics simulation system.
It would be advantageous to provide a system and method for producing screen space effects in a real time graphics system without increasing the hardware required for graphic acceleration. In addition, it would be valuable to use a hardware graphics subsystem or alpha channel which is not utilized in real time graphic simulation systems. Accordingly, it would be an improvement over the state of the art to provide a new method and apparatus for utilizing the alpha channel which is redundant in multi-sample mode.
It is an object of the present invention to utilize an alpha channel for processing screen space effects.
It is another object of the present invention to utilize an alpha channel to process the illumination effects of a vehicle mounted light source.
It is another object of the present invention to utilize alpha buffer memory to store screen space effects data.
It is another object of the present invention to utilize a post processor to apply screen space effects to the color data in the frame buffer.
It is another object of the present invention to utilize the alpha channel to process range data for polygons in a simulated scene.
It is another object of the present invention to identify luminous primitives as they are rendered so that they will not be attenuated in the post processor.
It is yet another object of the present invention to utilize an alpha buffer to store range values.
The presently preferred embodiment of the present invention is a graphics accelerator with a frame buffer. The graphics accelerator includes an alpha processing channel. The frame buffer includes an alpha memory coupled to the alpha processing channel. Screen effect data is stored in the alpha memory and is rendered and transformed by the alpha processing channel. The post processor then transforms the screen effect data and applies screen effects to data in the frame buffer.
The method for the invention uses a graphics accelerator for screen effects. The first step is providing a rendering engine with an alpha processing channel, a frame buffer that includes an alpha memory, and a post processor. The next step is processing screen effect data through the alpha channel. The third step is storing screen effect data in the alpha buffer memory. The fourth step is applying the screen effect data to the frame buffer color data using the post processor. The screen space effects which may be applied are effects such as ship mounted landing light lobes, double buffered overlays, edge blending attenuation at graphics channel boundaries, and range attenuation.